package com.abcdefg.springaopdemo.proxy;

/**
 * 代理类
 */
public class HouseProxy implements HouseSubject{
    private HouseSubject realHouseSubject;
    public HouseProxy(HouseSubject realHouseSubject) {
        this.realHouseSubject = realHouseSubject;
    }

    @Override
    public void saleHouse() {
        System.out.println("我是代理商，我帮房东开始代理出租房");
        realHouseSubject.saleHouse();
        System.out.println("我是代理商，我帮房东结束代理出租房");
    }

    @Override
    public void buyHouse() {
        System.out.println("我是代理商，我帮房东开始代理卖方");
        realHouseSubject.saleHouse();
        System.out.println("我是代理商，我帮房东结束代理卖房");
    }
}
